export const map = [
  {
    path: '*',
    redirect: '/'
  },
  {
    path: '/',
    name: '首页',
    component: resolve => {
      require(['../views/home'], resolve)
    }
  },
  {
    path: '/category',
    name: '分类',
    component: resolve => {
      require(['../views/category'], resolve)
    }
  },
  {
    path: '/main-category/:id',
    name: '分类商品',
    component: resolve => {
      require(['../views/category/main-category.vue'], resolve)
    }
  },
  {
    path: '/sub-category/:id',
    name: '子分类商品',
    component: resolve => {
      require(['../views/category/sub-category.vue'], resolve)
    }
  },
  {
    path: '/goods/:id',
    name: '商品详情',
    component: resolve => {
      require(['../views/goods'], resolve)
    }
  },
  {
    path: '/ecoupon',
    name: '电子券',
    component: resolve => {
      require(['../views/ecoupon'], resolve)
    }
  },
  {
    path: '/ecoupon/:goods_type',
    name: '电子券列表',
    component: resolve => {
      require(['../views/ecoupon/list.vue'], resolve)
    }
  },
  {
    path: '/ecoupon/:goods_type/detail/:ecoupon_id',
    name: '电子券详情',
    component: resolve => {
      require(['../views/ecoupon/detail.vue'], resolve)
    }
  },
  {
    path: '/login',
    name: '登陆',
    component: resolve => {
      require(['../views/system/login.vue'], resolve)
    }
  },
  {
    path: '/reg',
    name: '注册',
    component: resolve => {
      require(['../views/system/reg.vue'], resolve)
    }
  },
  {
    path: '/shoppingcart',
    name: '购物车',
    component: resolve => {
      require(['../views/shoppingcart'], resolve)
    },
    meta: {
      requiresAuth: true
    }
  },
  {
    path: '/mine',
    name: '我的',
    component: resolve => {
      require(['../views/mine'], resolve)
    },
    meta: {
      requiresAuth: true
    }
  }
]
